<template>
  <div class="hm-layout">
    <!-- 二级路由出口 -->
    <router-view></router-view>

    <van-tabbar
      v-model="active"
      route
      active-color="#fa6d1d"
      inactive-color="#000"
      @change="onChange"
    >
      <van-tabbar-item icon="home-o" to="/home/recommend">面经</van-tabbar-item>
      <van-tabbar-item icon="search" to="/collection">收藏</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="/like">点赞</van-tabbar-item>
      <van-tabbar-item icon="setting-o" to="/mine">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {
  name: 'HmLayout',
  components: {},
  props: {},
  data() {
    return {
      active: 0
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    onChange(index) {
      this.active = index
    }
  }
}
</script>
<style lang="less" scoped></style>
